package com.practice.car.cardataapp.controller;

import com.practice.car.cardataapp.entity.LoginForm;
import com.practice.car.cardataapp.util.R;
import org.springframework.web.bind.annotation.*;

import javax.crypto.KeyGenerator;
import java.util.UUID;

/**
 * car-data-app project
 *
 * @author FlagDied
 * @date 2020/9/2
 */
@RestController
public class SystemManagerLoginController {


	@GetMapping("/getLogin")
	public void login(@RequestParam("me") String username, @RequestParam("today") String password) {
		System.out.println("getlogin");
		System.out.println(username);
		System.out.println(password);
	}

	@PostMapping("/postLogin")
	public R login(@RequestBody LoginForm loginForm) {
		System.out.println("postLogin");
		System.out.println(loginForm);
		String uuidString = UUID.randomUUID().toString();
		return R.create().put("token", uuidString);
	}
}
